from pymysql import Connection
con = Connection(
    host='localhost',
    port=3306,
    user='root',
    password='CZxin054416@',
    autocommit=True # 自动确认
)
print(con.get_server_info())
cur = con.cursor()
con.select_db("mybatis")
# cur.execute("create table test_pymysql(id int, name varchar(20), age int)")
cur.execute("insert into test_pymysql values(2, 'xixi2', 22)")
con.commit() # 插入数据了需要确认
cur.execute("select * from test_pymysql")
result: tuple = cur.fetchall()
for r in result:
    print(r)
cur.close()